<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
    require 'dbcon.php';
    $slug=$_REQUEST['slug'];
    $title=$_REQUEST['title'];   
    $email=$_REQUEST['email'];
    $feature=$_REQUEST['feature'];
    $content=$_REQUEST['content'];
    $date_of_birth=$_REQUEST['date_of_birth'];
    $date_of_entry=$_REQUEST['date_of_entry'];
    $sql="insert into posts(slug,title,email,feature,content) values('{$slug}','{$title}','{$email}','{$feature}','{$content}');";
    $rs=$db->query($sql);
    if ($rs==true)
    {
        header("Location:index.php");
    }
    else
    {
        echo '<script type="text/javascript"> ';
        echo 'alert("留言失败！")';
        echo 'window.location.href="index.php"';
        echo '</script>';
    }
